package com.example.springboothello.controller;

import com.example.springboothello.common.R;
import com.example.springboothello.util.sendEmail;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("sendEmail")
public class SendEmailController {

    @PostMapping("send")
    public R<String> send(String hostEmail,String emailName, String msg) {
        // 写从1到10循环的代码
        if (sendEmail.sendAuthCodeEmail("2564167401@qq.com",hostEmail,emailName,msg)) {
            return R.success("发送成功");
        }
        return R.error("发送失败");
    }

}
